package vboot.app.module.sa.agent.main;

import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import vboot.core.common.entity.BaseMainEntity;
import vboot.core.module.sys.org.root.SysOrg;

import javax.persistence.*;
import java.util.List;

@Entity
@Getter
@Setter
public class SaAgentMain extends BaseMainEntity {

    //--------地址相关信息------<<<
    private String addre;//完整地址

    @Column(length = 64)
    private String adreg;//省市区

    @Column(length = 128)
    private String addet;//省市区以外的详细信息

    @Column(length = 32)
    private String adcoo;//经纬度

    @Column(length = 32)
    private String adpro;//省

    @Column(length = 32)
    private String adcit;//市

    @Column(length = 32)
    private String addis;//区
    //--------地址相关信息------>>>

    @Column(length = 32)
    private String level;//代理商资质

    @Column(length = 32)
    private String senum;//流水号

    @ApiModelProperty("备注")
    private String notes;

    @ManyToOne
    @JoinColumn(name = "opman")
    private SysOrg opman;//创建人

    @ManyToMany
    @JoinTable(name = "sa_agent_main_viewer", joinColumns = {@JoinColumn(name = "mid")},
            inverseJoinColumns = {@JoinColumn(name = "oid")})
    private List<SysOrg> viewers;
}